import request from '@/utils/request'

// 查询公寓楼信息列表
export function list(query) {
  return request({
    url: '/dorm/bed/list',
    method: 'get',
    params: query
    
  })
}

// 导出公寓楼信息列表
export function exportList(query) {
  return request({
    url: '/dorm/bed/export',
    method: 'post',
    data: query
  })
}

// 导出公寓楼信息列表
export function exportDormAllocationInfolist(query) {
  return request({
    url: '/dorm/bed/exportDormAllocationInfolist',
    method: 'get',
    params: query,
    responseType:'blob'
  })
}


// 获取公寓楼信息详细信息
export function getbedInfoById(query) {
  return request({
    url: '/dorm/bed/' + query.bedId,
    method: 'get',
    params: query
  })
}


// 新增公寓楼信息
export function addInfo(query) {
  return request({
    url: '/dorm/user/bed/add',
    method: 'post',
    data: query
  })
}


// 删除公寓楼层信息
export function delInfoById(query) {
  return request({
    url: '/dorm/user/bed/delete/' + query.bedIds,
    method: 'DELETE',
    params: query
  })
}

// 清除宿舍下的床位信息
export function deleteUseBedByRoomIds(query) {
  return request({
    url: '/dorm/user/bed/deleteUseBedByRoomIds/' + query.roomids,
    method: 'DELETE',
    params: query
  })
}

// 查询学生宿舍分配记录
export function getDormAllocationInfolist(query) {
  return request({
    url: "/dorm/bed/getDormAllocationInfolist",
    method: 'get',
    params: query
  })
}

//查询学生床位信息列表
export function getUserBedList(query) {
  return request({
    url: "/dorm/user/bed/list",
    method: 'get',
    params: query
  })

  
}

//查询宿舍分配记录
export function getuserBedLog(query) {
  return request({
    url: "/dorm/userBedLog/list",
    method: 'get',
    params: query
  })
}

// 修改宿舍床位信息
export function updateBedInfo(query) {
  return request({
    url: "/dorm/user/bed/update",
    method: 'put',
    data: query
  })
}
